package com.example.mine_platform.mapper;

import com.example.mine_platform.pojo.dto.CheckClockDTO;
import com.example.mine_platform.pojo.entities.CheckClock;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface CheckClockMapper extends Mapper<CheckClock> {

    @Select({"<script>",
            "select a.*,b.user_name from checkclock a " +
            "left join user b on b.id=a.user_id " +
            "WHERE a.deleted=0",
            "<when test='userName!=null'>",
            "AND b.user_name like concat('%',#{userName},'%')",
            "</when>",
            "</script>"})
    List<CheckClockDTO> selectwithUser(String userName);
}